package backgammon;

import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.HeadlessException;
import javax.swing.JFrame;

/**
 * <p>Displays the board to the GUI.</p>
 * @author Jacob Kwitkoski
 * @version 1.0
 */
public class GUIBoardDisplayer extends JFrame implements BoardDisplayer {

    private Board board;

    private StatPanel stats;

    public GUIBoardDisplayer(String    title,
                             Board     newBoard,
                             StatPanel newStats) throws HeadlessException {
        super(title);
        board = newBoard;
        stats = newStats;
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        GridBagLayout layout = new GridBagLayout();
        GridBagConstraints c = new GridBagConstraints();
        setLayout(layout);

        c.fill = c.BOTH;
        c.weightx = 0.78;
        c.weighty = 1.0;
        add(board, c);
        
        c.weightx = 0.22;
        add(stats, c);

        pack();
        setBounds(300, 150, 950, 528);
        setResizable(false);
        setVisible(true);
    }

    /**
     * <p>Displays the board.</p>
     * @param gameBoard the board to display
     */
    public void display(Board gameBoard) {
    }
}
